find index of object in array javascript by key